<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Form Test</title>
<link rel="stylesheet" href="../css/form.css" type="text/css" />

<script type="text/javascript" src="../liwe.js"></script>
<script type="text/javascript" src="../locale.js"></script>
<script type="text/javascript" src="../utils.js"></script>
<script type="text/javascript" src="../object_enh.js"></script>
<script type="text/javascript" src="../array_enh.js"></script>
<script type="text/javascript" src="../string_enh.js"></script>
<script type="text/javascript" src="../money.js"></script>
<script type="text/javascript" src="../form.js"></script>
<script type="text/javascript" src="../validators.js"></script>
<script type="text/javascript" src="../../os3wwl/os3calendar/os3calendar.js"></script>
<script type="text/javascript" src="../../os3wwl/html_ed/htmled.js"></script>
<script type="text/javascript" src="../locale/it/form.js"></script>

<script type="text/javascript" src="../../os3wwl/os3grid/os3grid.js"></script>
<link rel="stylesheet" href="../../os3wwl/os3calendar/os3calendar.css" type="text/css" />
<link rel="stylesheet" href="../../os3wwl/html_ed/styles/styles.css" type="text/css" />
<link rel="stylesheet" href="../../os3wwl/html_ed/styles/toolbar.css" type="text/css" />
<link rel="stylesheet" href="../../os3wwl/os3grid/os3grid.css" type="text/css" />
<script type="text/javascript">
function check_minuscole ( v )
{
	return v.isLower ();
}

function set_to_lower ( e )
{
	e.value = e.value.toLowerCase ();
}

function do_grid ()
{
	var g = os3grid_get_grid ( 'my_grid' );

	g.add_row ( "Fabio", "Rotondo", "fabio@rotondo.it" );

	g.render ();
}

function create_form ()
{
	liwe._libbase = "../";
	
	var f = new liwe.form.instance ( 'test' );
	var opts = [
			{ value: 1, label: "Item 1" },
			{ value: 2, label: "Item 2" },
			{ value: 3, label: "Item 3" }
		   ];

	f.text ( { label: "Inserisci la login", name: "login", akey: 'l', mandatory: true, value: "tua login" } );
	f.password ( { label: "Inserisci la password", name: "passwd", akey: 'p', mandatory: true } );
	f.email ( { label: "Inserisci la e-mail", name: "email", akey: 'e', validator: true } );
	f.sep ();
	f.money ( { label: "money", name: "soldi" } );
	f.text ( { label: "Solo minuscole", name: "minus", validator: check_minuscole, onblur: "set_to_lower(this);" } );
	f.select ( { label: "Seleziona", name: "sel", options: opts, force_select: true, mandatory: true } );
	// f.calendar ( { label: "Metti data", name: "data", value: "2006-01-01" } );
	f.ipaddr ( { label: "IP Addr", name: "ip" } );
	f.submit ( { value: "Vai!!!" } );
	f.cod_fisc ( { label: "Codice Fiscale", name: "cod_fisc", validator: true } );
	f.p_iva ( { label: "Partita IVA", name: "p_iva", validator: true } );
	f.set ( 'my_form' );

/*
	f = new liwe.form.instance ( 'test2' );
	f.text ( { label: "Just a little text", name: "login", mandatory: true } );
	f.button ( { value: "Ciao" } );
	f.htmlarea ( { label: "HTML", name: "html", mandatory: true } );
	f.submit ( { value: "Ok" } );
	

	f.set ( 'my_form2' );

	f = new liwe.form.instance ( 'test3' );
	var g = f.grid ( { name: "my_grid" } );
	f.button ( { value: "griglia", onclick: "do_grid()" } );
	
	f.set ( 'my_form3' );

	g.set_headers ( 'Name', 'Surname', 'E-Mail' );
	g.render ();
*/
}
</script>
</head> 
<body onload="create_form()">

<div id="my_form"></div>
<div id="my_form2"></div>
<div id="my_form3"></div>



</body>
</html>
